import java.io.*;
import java.net.*;

public class Client2
{
	public static void main(String [] args) throws Exception
	{
		Socket mySocket = null;
		BufferedReader in =null;

		try{
			mySocket = new Socket("localhost", 1234);
			in = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
			String fromServer = in.readLine();
			System.out.println(fromServer);
			in.close();
		}catch(UnknownHostException e){
			System.err.println("Don't know about this host");
			System.exit(1);
		}catch(IOException e){
			System.err.println("Couldn't get I/O for the connection");
			System.exit(1);
		}
		mySocket.close();
	}
}